<script>
	 $(function(){
  $('.confirm').click(function(){
    var r=confirm("Apakah Anda yakin akan menghapus data? ")
  if (r==false)
    {
    return false;
    }
  });
});  
</script>
<?php if(!defined('BASEPATH')) exit ('No direct script access allowed');?>
<div id="main-content">
	<div class='title'>Daftar Surat Keluar</div>
	
	<?php echo anchor('con_surat_keluar/tambah','Tambah Surat Keluar Baru');?>
	<table class='data' width='100%'>
		<tr>
			<th width='5%' align='left'>No</th>
			<th width='20%' align='left'>No Surat</th>
			<th width='20%' align='left'>Tanggal Surat</th>
			<th width='40%' align='left'>Tujuan Surat</th>
			<th width='15%' align='center'>Aksi</th>
		</tr>
		<?php
		$no = 1;
		foreach($all_surat_keluar->result() as $row)
		{
		?>
		<tr>
			<td><?php echo $no ;?></td>
			<td><?php echo $row->NO_SURAT;?></td>
			<td align="center">
			<?php
				$this->load->helper('tanggal');
				$strdate = $row->TANGGAL_SURAT;
				$date = strtotime($strdate);
				$tgl = date('d',$date);
				$bulan = date('m',$date);
				$nmbulan = konversiBulan($bulan);
				$tahun = date('Y',$date);
				echo $tgl.'-'.$nmbulan.'-'.$tahun;
			?>
			</td>
			<td><?php echo $row->TUJUAN;?></td>
			<td align='center'>
			<?php
			echo anchor('con_surat_keluar/edit/'.$row->ID_SURAT_KELUAR,'<img src="'.base_url().'asset/icon/edit.png" alt="Hapus" width="20" height="20" />');
			echo '-';
			echo anchor('con_surat_keluar/hapus/'.$row->ID_SURAT_KELUAR,'<img src="'.base_url().'asset/icon/hapus.png" alt="Hapus" width="20" height="20" />',array('class'=>'confirm'));
			echo '-';
			echo anchor('con_surat_keluar/print_skel/'.$row->ID_SURAT_KELUAR,'<img src="'.base_url().'asset/icon/print.png" alt="Hapus" width="20" height="20" />');
			?>
			</td>
		</tr>
		<?php
		$no++;
		}
		?>
		</table>
</div>